/**
 * ResponseScriptAPI.java
 * ************************** 
 * @date May 18, 2011
 * @author Michele Tamburini
 * 
 * **************************
 */
package infrastructureAPI.backendGate.scriptsResponse;

import infrastructureAPI.APIMessages.ResponseMessage;

/**
 * Description:
 * The ResponseReceiverScriptAPI defines and interface used by the scripts.
 * Once initialized a ResponseReceiverScriptAPI is able
 * to retrieve the incoming response(s) from the Back-End.
 * The method waitForResponseMessage() is able to wait until a 
 * ResponseMessage comes into the waiting queue.  
 *
 */
public interface ResponseReceiverScriptAPI{
	
	/**
	 * Returns the ResponseMessage that's arrived into the
	 * message queue. 
	 * It's a blocking function until a message notifies the modification
	 * of the queue.
	 * @return message : ResponseMessage
	 */
	public ResponseMessage waitForResponseMessage();
	
	/**
	 * Initialize the ResponseReceiverScriptAPI by registering
	 * it into the local rmiregistry.
	 * @return done : boolean
	 */
	public boolean initializeAndConnect();

	/**
	 * Terminates the current ResponseReceiverScriptAPI.
	 * @return done : boolean
	 */
	public boolean terminate();

}
